// stores/pileStore.js
import { defineStore } from 'pinia';
import {ref} from "vue";

/**
 * 创建一个pile 对象，包含一个属性editRowData对象，和一个方法setEditRowData，并返回
 * @type {StoreDefinition<"pile", _ExtractStateFromSetupStore<{editRowData: [{}] extends [Ref] ? IfAny<{}, Ref<{}>, {}> : Ref<UnwrapRef<{}>, UnwrapRef<{}> | {}>, setEditRowData: function(*): void}>, _ExtractGettersFromSetupStore<{editRowData: [{}] extends [Ref] ? IfAny<{}, Ref<{}>, {}> : Ref<UnwrapRef<{}>, UnwrapRef<{}> | {}>, setEditRowData: function(*): void}>, _ExtractActionsFromSetupStore<{editRowData: [{}] extends [Ref] ? IfAny<{}, Ref<{}>, {}> : Ref<UnwrapRef<{}>, UnwrapRef<{}> | {}>, setEditRowData: function(*): void}>>}
 */
export const usePileStore = defineStore('pile', ()=>{
    const editRowData=ref({})
    const setEditRowData=(data)=> {
        console.log("usePileStore =>",data)
        this.editRowData.value= data
    }
    return {editRowData,setEditRowData}
})